import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';

import { AppComponent } from './app.component';
import { HeroModule } from './modules/hero/hero.module';
import { AppRoutingModule } from './app-routing.module'
import { AdminModule } from './modules//admin/admin.module';

import { AuthService } from './auth-service';

import { ModalModule } from 'ngx-bootstrap/modal';


import { CrisisComponent } from './modules//crisis/crisis.component';
import { LoginComponent } from './login/login.component';
import { AboutComponent } from './modules//about/about.component';
import { PageNotFoundComponent } from './modules//page-not-found/page-not-found.component';
import { ComposeMessageComponent } from './compose-message/compose-message.component';


@NgModule({
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    ModalModule.forRoot(),
    HttpModule,
    FormsModule,
    HeroModule,
    AdminModule,
    AppRoutingModule, // 确保AppRoutingModule是最后一个
    /**
     如果它位于子模块(HeroModule)之前，那么分析一下:
         AppRoutingModule里面包含的路由数组是:{'','login','**(404)'},
         HeroModule/hero-routing.module：{'heroes','hero/:'}
         最终系统里面的路由表会变成:{'','login','**(404)','heroes','hero/:'}，没错，404页面就在其他地址之前.
         这样：按照导航由上到下的顺序，永远不会导航到404后面的页面了.
    */
  ],
  declarations: [
    AppComponent,
    CrisisComponent,
    LoginComponent,
    AboutComponent,
    PageNotFoundComponent,
    ComposeMessageComponent,
  ],
  providers: [AuthService],
  bootstrap: [AppComponent]
})
export class AppModule { }

// to branch "master"
